import { createEnum } from '@/utils/createEnum';

export enum GUIDE_TYPE {
  // 科室位置
  DEPARTMENT_LOCATION,
  // 标本采集指引
  SAMPLE_COLLECTION_GUIDANCE
}

export const guideTypeList = createEnum([
  ['DEPARTMENT_LOCATION', GUIDE_TYPE.DEPARTMENT_LOCATION, '科室位置'],
  ['SAMPLE_COLLECTION_GUIDANCE', GUIDE_TYPE.SAMPLE_COLLECTION_GUIDANCE, '标本采集指引']
]);

export enum STATUS {
  DISABLED = 'disabled',
  DANGER = 'danger',
  WARNING = 'warning',
  NORMAL = 'normal'
}

/**
 * @param available  可预约数
 * @param isAfterTime  时间段是否在当前时间之后
 * @returns
 */
export function getStatus(available: number, isAfterTime: boolean): STATUS {
  if (!isAfterTime)
    return STATUS.DISABLED;
  if (available > 5)
    return STATUS.NORMAL;
  if (available > 3)
    return STATUS.WARNING;
  if (available > 0)
    return STATUS.DANGER;
  return STATUS.DISABLED;
}
